//
//  TTRecyclingHomeTopView.m
//  TaoTuo
//
//  Created by LG on 2020/8/24.
//  Copyright © 2020 刘广. All rights reserved.
//

#import "TTRecyclingHomeTopView.h"
#import "TTRecyclingValuationViewController.h"
#import "TTFastBeforeViewController.h"

#import "TTRecyclingListOneViewController.h"
#import "TTRecyclingListTwoViewController.h"
#import "TTRecyclingMyBuyViewController.h"


@interface TTRecyclingHomeTopView ()
@property (weak, nonatomic) IBOutlet UIView *topBgView;
@property (weak, nonatomic) IBOutlet UILabel *gjCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *zsCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *gmCountLabel;
@property (weak, nonatomic) IBOutlet UIImageView *gujiaImgView;
@property (weak, nonatomic) IBOutlet UIImageView *huishouImgView;


@end

@implementation TTRecyclingHomeTopView

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    self.topBgView.layer.cornerRadius = 8;
    self.topBgView.layer.shadowColor = UIColorHex(C3C3C3).CGColor;
    self.topBgView.layer.shadowOpacity = 0.5;
    self.topBgView.layer.shadowOffset = CGSizeZero;
    self.topBgView.layer.shadowPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, kScreenWidth - 30, 80)].CGPath;
    
    self.gujiaImgView.layer.cornerRadius = 10;
    self.gujiaImgView.layer.masksToBounds = YES;
    self.gujiaImgView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gujiaTap)];
    [self.gujiaImgView addGestureRecognizer:tap1];
    
    self.huishouImgView.layer.cornerRadius = 10;
    self.huishouImgView.layer.masksToBounds = YES;
    self.huishouImgView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(huishouTap)];
    [self.huishouImgView addGestureRecognizer:tap2];
    
}

- (void)setDic:(NSDictionary *)dic
{
    _dic = dic;
    self.gjCountLabel.text = [NSString stringWithFormat:@"%@", dic[@"ReclaimInformationCount"]];
    self.zsCountLabel.text = [NSString stringWithFormat:@"%@", dic[@"ReclaimInformationGoodsCount"]];
    self.gmCountLabel.text = [NSString stringWithFormat:@"%@", dic[@"ReclaimInformationBuyGoodsCount"]];
}

- (void)gujiaTap
{
    TTFastBeforeViewController *vc = [[TTFastBeforeViewController alloc] initWithNibName:@"TTFastBeforeViewController" bundle:[NSBundle mainBundle]];

    [[LLRouteTool getCurrentNavigationController] pushViewController:vc animated:YES];
}

- (void)huishouTap
{
    TTRecyclingValuationViewController *vc = [[TTRecyclingValuationViewController alloc] init];
    [[LLRouteTool getCurrentNavigationController] pushViewController:vc animated:YES];
}

// 我的估价
- (IBAction)myGujiaAction:(id)sender {
    
    TTRecyclingListOneViewController *listVC = [[TTRecyclingListOneViewController alloc] init];
    [[LLRouteTool getCurrentNavigationController] pushViewController:listVC animated:YES];
    
    
}

// 我的在售
- (IBAction)mySellAction:(id)sender {
    
    
    TTRecyclingListTwoViewController *listVC = [[TTRecyclingListTwoViewController alloc] init];
    [[LLRouteTool getCurrentNavigationController] pushViewController:listVC animated:YES];
    
}


// 我的购买
- (IBAction)myBuyAction:(id)sender {
    
    TTRecyclingMyBuyViewController *listVC = [[TTRecyclingMyBuyViewController alloc] init];
    [[LLRouteTool getCurrentNavigationController] pushViewController:listVC animated:YES];
    
}


@end
